package com.miniapp.handler.exception;

import com.miniapp.entity.R;
import lombok.Getter;

/**
 * 自定义业务异常
 */
@Getter
public class BusinessException extends RuntimeException {

    private final int code;

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message) {
        super(message);
        this.code = R.ERROR_CODE_SYSTEM;
    }

    public int getCode() {
        return code;
    }
}
